import request from '@/router/axios';
// 删除诊断记录
export const delDiagnosticById = (id) => {
  return request({
    url: '/api/blade-platform/peportInfo/delDiagnosticById/' + id,
    method: 'get'
  })
}
// 删除报告单
export const delRepotinfoById = (id) => {
  return request({
    url: '/api/blade-platform/peportInfo/delRepotinfoById/' + id,
    method: 'get'
  })
}
// 获取诊断id
export const getDiagnosticId = () => {
  return request({
    url: '/api/blade-platform/peportInfo/getDiagnosticId',
    method: 'get'
  })
}
export const getDiagnosticList = (patientId) => {
  return request({
    url: '/api/blade-platform/peportInfo/getDiagnosticList/' + patientId,
    method: 'get'
  })
}
// 文件上传
export const uploadFile = (file) => {
  return request({
    url: '/api/blade-resource/oss/endpoint/put-file?code=minio',
    method: 'post',
    data: file
  })
}
export const uploadFile2 = (file) => {
  return request({
    url: '/api/blade-platform/medication/image',
    method: 'post',
    data: file
  })
}
export const uploadFile3 = (file) => {
  return request({
    url: '/api/blade-resource/oss/endpoint/put-file?code=minio',
    method: 'post',
    data: file
  })
}
// 问诊单下拉框
export const inquiryTableList = () => {
  return request({
    url: '/api/blade-platform/inquiryTable/dropDown',
    method: 'get'
  })
}
// 获取问诊单的对应得问诊项
export const getDetail = (id) => {
  return request({
    url: '/api/blade-platform/inquiryTable/infov2',
    method: 'get',
    params: {
      id,
    }
  })
}
// 新增的时候获取
export const getRecordApi = (patientId,description) => {
  return request({
    url: '/api/blade-platform/inquiryTable/infov3',
    method: 'get',
    params: {
      patientId,
      description
    }
  })
}

export const getRecordApi2 = (patientId) => {
  return request({
    url: '/api/blade-platform/medication/diagnosisLists',
    method: 'get',
    params: {
      patientId,
    }
  })
}

export const getFuzhuCheckApi = (patientId) => {
  return request({
    url: '/api/blade-platform/inquiryTable/infov4',
    method: 'get',
    params: {
      patientId,
    }
  })
}
//分级
export const fenjiApi = (query) => {
  return request({
    url: '/api/blade-platform/medication/examination',
    method: 'post',
    data: query
  })
}
//获取年龄
export const getAgeApi = (patientId) => {
  return request({
    url: '/api/blade-platform/medication/modifiedAsthma',
    method: 'get',
    params: {
      patientId,
    }

  })
}
//慢性保存
export const manxingApi = (query) => {
  return request({
    url: '/api/blade-platform/medication/controlLevel',
    method: 'post',
    data: query
  })
}
//6岁以上保存
export const over6Api = (query) => {
  return request({
    url: '/api/blade-platform/medication/classification',
    method: 'post',
    data: query
  })
}
//6岁以下保存
export const above6Api = (query) => {
  return request({
    url: '/api/blade-platform/medication/classificationSix',
    method: 'post',
    data: query
  })
}
export const getRuleType = () => {
  return request({
    url: '/api/blade-platform/medication/ruleType',
    method: 'get',

  })
}
//用药
export const getMedication = (query) => {
  return request({
    url: '/api/blade-platform/medication/diagnosis',
    method: 'post',
    data: query
  })
}
// 提交第一步
export const peportInfoOne = (query) => {
  return request({
    url: '/api/blade-platform/peportInfo/addOrEdit/one',
    method: 'post',
    data: query
  })
}
// 提交第三步
export const peportInfoThree = (query) => {
  return request({
    url: '/api/blade-platform/peportInfo/addOrEdit/three',
    method: 'post',
    data: query
  })
}
// 报告单类型下拉框
export const algorithmType = () => {
  return request({
    url: '/api/blade-platform/caseReport/algorithmType',
    method: 'get'
  })
}
// 上传报告单OCR识别
export const filetwo = (query) => {
  return request({
    url: '/api/blade-platform/peportInfo/addOrEdit/filetwo',
    method: 'post',
    data: query
  })
}
// 编辑报告单
export const editReportData = (query) => {
  return request({
    url: '/api/blade-platform/peportInfo/edit',
    method: 'put',
    data: query
  })
}
// 诊断记录查看
export const findDiagnostic = (id, operationType) => {
  return request({
    url: '/api/blade-platform/peportInfo/findDiagnostic/' + id + '/' + operationType,
    method: 'get'
  })
}
// 评分
export const putScore = (id, score) => {
  return request({
    url: '/api/blade-platform/peportInfo/putScore/' + id + '?score=' + score,
    method: 'get'
  })
}
// 诊断
export const diagnosis = (query) => {
  return request({
    url: '/api/blade-platform/inquiryTable/diagnosis',
    method: 'post',
    data: query
  })
}
// 折线图
export const reportTheLineChart = (query) => {
  return request({
    url: '/api/blade-platform/peportInfo/reportTheLineChart',
    method: 'post',
    data: query
  })
}
// 获取单个报告单数据
export const getRepotinfo = (reportInfoId, operationType) => {
  return request({
    url: '/api/blade-platform/peportInfo/getRepotinfo/' + reportInfoId + '/' + operationType,
    method: 'get'
  })
}
//用药列表
export const medicineList2 = () => {
  return request({
    url: '/api/blade-platform/medication/medicationType2',
    method: 'get',
  })
}
export const medicineList3 = () => {
  return request({
    url: '/api/blade-platform/medication/medicationType3',
    method: 'get',
  })
}
export const medicineList4 = () => {
  return request({
    url: '/api/blade-platform/medication/medicationType4',
    method: 'get',
  })
}
export const medicineList5 = () => {
  return request({
    url: '/api/blade-platform/medication/medicationType5',
    method: 'get',
  })
}
//保存用药
export const saveMedicine = (data) => {
  return request({
    url: '/api/blade-platform/medication/updateMedication',
    method: 'post',
    data
  })
}
//报告单选择其他
export const saveOtherReport = (data) => {
  return request({
    url: '/api/blade-platform/medication/otherAlgorithm',
    method: 'post',
    data
  })
}